home *** CD-ROM | disk | FTP | other *** search
/ Champak 123 / (Vol 123) Jan 13 2011.iso / Games / island_fishing.swf / scripts / frame_63 / DoAction.as
Text File  |  2011-01-13  |  1KB  |  49 lines

  1. stop();
  2. _root.hunger = 100;
  3. _root.fishtotal = 0;
  4. _root.fish = 0;
  5. x1 = _root.rodend._x;
  6. y1 = _root.rodend._y;
  7. this.onEnterFrame = function()
  8. {
  9.    controlX = _root.hook._x;
  10.    controlY = _root.hook._y;
  11.    this.clear();
  12.    this.lineStyle(1,0,100);
  13.    this.moveTo(x1,y1);
  14.    this.lineTo(controlX,controlY,x2,y2);
  15. };
  16. onMouseDown = function()
  17. {
  18.    if(_root.reelable >= 1)
  19.    {
  20.       tx = _root.hook._x;
  21.       mx = _root.rodend._x;
  22.       rx = tx - mx;
  23.       if(rx >= 1)
  24.       {
  25.          _root.hook._x -= _root.speed;
  26.       }
  27.       if(rx <= -1 && rx > -300)
  28.       {
  29.          _root.hook._x += _root.speed;
  30.       }
  31.       if(rx <= 1)
  32.       {
  33.          ty = _root.hook._y;
  34.          my = _root.rodend._y;
  35.          ry = ty - my;
  36.          if(ry >= 1)
  37.          {
  38.             _root.hook._y -= _root.speed;
  39.          }
  40.          if(ry <= -1 && ry > -300)
  41.          {
  42.             _root.hook._y += _root.speed;
  43.          }
  44.       }
  45.       _root.guy.hand.play();
  46.    }
  47. };
  48. Mouse.addListener(myListener);
  49.